package com.xigua.principle.inversion.improve;

public class DependencyInversion {
    public static void main(String[] args) {
        Person person = new Person();
        person.receive(new Email());
    }

}

interface Receive{
    String getInfo();
}

class Person{
    public void receive(Receive receive){
        System.out.println(receive.getInfo());
    }
}

class Email implements Receive{
    public String getInfo(){
        return "电子邮件信息:helloWorld";
    }
}
